<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Cache-Control" content="No-Cache">
	<meta http-equiv="Pragma" content="No-Cache">

	<title>HttpRequest Test</title>
</head>

<body>
<?php
	
	$arrPostFields = array(
			'yyyy' => '2012',
			'url'=>'218.145.66.136',
			'fip'=>'',
			'fsize'=>'',
			'ref'=>'',
			'solution_var'=>'DB',
			'urltemp'=>'',
			'cate'=>'gunghap',
			'sel'=>'1',
			'nextresult'=>'',
			'user_name'=>'정우성',
			'your_user_name'=>'김태희',
			'solunar'=>'lunar',
			'request_year'=>'1980',
			'request_month'=>'01',
			'request_day'=>'30',
			'request_hour'=>'0',
			'request_min'=>'00',
			'youn'=>'0',
			'your_year'=>'1980',
			'your_month'=>'03',
			'your_day'=>'30',
			'your_hour'=>'0',
			'your_min'=>'00',
			'your_youn'=>'0',
			'your_solunar'=>'solar',
			'sex'=>'남'
	);

	$r = new HttpRequest('http://218.145.66.136/UNSE_DATA/unse/gunghap/bridge/outerMatch.asp', HttpRequest::METH_POST);
//	$r = new HttpRequest('http://218.145.66.136/UNSE_DATA/unse/gunghap/bridge/myLover.asp', HttpRequest::METH_POST);
	$r->addPostFields($arrPostFields);
//	$r->setOptions(array('cookies' => array('lang' => 'de')));

	

	try {
		$return_obj = json_decode($r->send()->getBody(), TRUE);
		// echo $r->send()->getBody();
	} catch (HttpException $ex) {
		echo $ex;
	}
	echo $return_obj['G023_MS']['data'];
	echo '<br>';
	echo $return_obj['G023_MS']['summary'];
	echo '<br>';
	echo $return_obj['G023_MS']['express'];
	echo '<br>';
	echo $return_obj['G023_MS']['numerical'];
	echo '<br>';
?>
</body>
</html>